home *** CD-ROM | disk | FTP | other *** search
- Path: isonews.bbn.hp.com!hpbblb!news
- From: Matthias Dittrich <matti>
- Newsgroups: comp.lang.c++
- Subject: Re: Leap year
- Date: 5 Mar 1996 08:15:40 GMT
- Organization: Hewlett-Packard Co.
- Message-ID: <4hgt7c$48h@hpbblb.bbn.hp.com>
- References: <3135A7F2.2120@hiwaay.net> <4hbiln$899@sam.inforamp.net>
- NNTP-Posting-Host: trabant.bbn.hp.com
- Mime-Version: 1.0
- Content-Type: text/plain; charset=us-ascii
- Content-Transfer-Encoding: 7bit
- X-Mailer: Mozilla 1.1N (X11; I; HP-UX A.09.07 9000/712)
- X-URL: news:4hbiln$899@sam.inforamp.net
-
- rmorin@inforamp.net (Randy Charles Morin) wrote:
- >In article <3135A7F2.2120@hiwaay.net>, Lance Perry <lperry@hiwaay.net> wrote:
- >>Can someone be kind enough to post the formula for Leap Year
- >>or point me to the place where this can be found?
- >>
- >>lperry@hiwaay.net
- >
- >bool IsLeapYear(int x)
- >{
- > return ((x&4) && ((!(x&100)) || (x&1000)));
- >}
- >
- >I hope I got everything right.
- >
- >Agrivar
- Sorry, this can't work!
- If you are comparing bit patterns, each number containing one of the bits
- in the pattern returns a value which is not zero. This means if x=5, the value
- of x&4 is 4, which is logical true.
- Please test your code before posting !!! This is no help :-(
-
- Good luck,
- Matthias
-
-